<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body{
            padding-bottom: 800px;
            padding-left: 30px;
        }
        .cbox{
            border: 1px solid #999;
            padding: 20px;
            margin-bottom: 10px;
        }
    </style>
</head>
<body>
    <div id="app">
        <!-- 局部组件的定义位置就是该组件父组件位置，此时局部组件只能被使用于父组件容器中 -->
        <p>createApp父组件</p>
        <comp-a></comp-a>
        <comp-b></comp-b>
    </div>

    <script type="text/x-template" id="CompA">
        <div class="cbox">
            <p>createApp-CompA</p>
            <!-- <comp-b></comp-b> -->
            <comp-c></comp-c>
        </div>
    </script>
    <script type="text/x-template" id="CompB">
        <div class="cbox">
            <p>createApp-CompB</p>
        </div>
    </script>
    <script type="text/x-template" id="CompC">
        <div class="cbox">
            <p>CompA-CompC</p>
        </div>
    </script>

    <script type="module">
        // 加载 Vue3 的ESM 模块文件
        import { createApp } from "../../assets/vue3/vue.esm-browser.js"
        createApp({
            data(){
                return {
                    
                }
            },
            components: {
                CompA:{
                    template:"#CompA",
                    components: {
                        CompC:{
                            template:"#CompC"
                        },
                    },
                },
                CompB:{
                    template:"#CompB"
                },
            },
        }).mount("#app")
    </script>
</body>
</html>